package com.wtwd.campus.attendancereceiver;




import com.wtwd.campus.common.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author ldaoliang
 * @Date create in 15:44 2021/3/25
 * @Description
 */
public class AttendanceReceiverFactory {

    private static final Logger logger = LoggerFactory.getLogger(AttendanceReceiverFactory.class);

    public static AttendanceReceiver createReceiver(String data) {
        //考勤机指令上报
        String cmd = data.substring(2, 4);
        if (Constants.IDENTITY.equals(cmd)) {
            return new IdentityReceiver();
        }else if(Constants.HEART_BEAT.equals(cmd)){
            return new HeartBeatReceiver();
        }else if(Constants.SEND_DATA.equals(cmd)){
            return new SendDataReceiver();
        }
        return null;
    }


}
